package com.qding.park.manager.app.queue.handle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.qding.park.common.core.exceptions.BaseException;
import com.qding.park.common.core.redis.SerializeUtils;
import com.qding.park.manager.facade.queue.service.ReportFacade;
import com.qding.park.manager.pojo.ap.ApReservationInReminder;
import com.qding.park.manager.pojo.queue.QueueMsg;

/**
  * @ClassName: ReserveDelayTimeoutHandle
  * @Description: 预定车辆进场消息
  * @author Comsys-Administrator
  * @date 2016年10月20日 上午10:10:31
  *
  */
@Component("reserveInckeckHandle")
public class ReserveInckeckHandle extends AbstractReportHandle{
	
	
	@Autowired
	private ReportFacade  reserveFacade;
	
	
	@Override
	void actualHandle(QueueMsg msg) throws BaseException {
		JSONObject data = (JSONObject) msg.getData();
		ApReservationInReminder apReservationInReminder=SerializeUtils.unSerialize(data.toJSONString(), ApReservationInReminder.class);
//		reportFacade.Park_EventAlert_ParkingAreaPrep(apReservationInReminder);
		reserveFacade.carInCheck(apReservationInReminder);
		
	}


	@Override
	boolean failDiscardRollBacK(QueueMsg msg) {
		_log.info("预定车辆进场回滚:"+msg);
		return true;
	}
	
}
